module.exports = (app) => {
  const mongoose = require('mongoose');
  mongoose.connect('mongodb://localhost:27017/king', {
    useUnifiedTopology: true,
    useNewUrlParser: true,
  });
  mongoose.connection.on('error', () => {
    console.log('Mongoose connection error');
  });
  mongoose.connection.on('open', () => {
    console.log('Mongoose connection success');
  });

  require('require-all')(__dirname + '/../models');
};
